package org.jeecg.common.i18n;

import org.apache.commons.lang.StringUtils;
import org.jeecg.common.util.SpringContextUtils;
import org.springframework.stereotype.Component;

@Component("language")
public class Language {
    public static String L(String code) {
        LocaleMessageSourceService localeMessageSourceService = (LocaleMessageSourceService) SpringContextUtils.getBean("localeMessageSourceService");
        if (StringUtils.isEmpty(code)) {
            return "code is not find!";
        } else {
            return localeMessageSourceService.getMessage(code) == null ? "" : localeMessageSourceService.getMessage(code);
        }
    }
}
